if (!jsx3.lang.Class.forName("ux.cdb.admin.loan.offerLoan.OfferLoanDetails")) {
    /**
     * Define the <code>name of class</code> class.
     * This class inherit from <code>jsx3.gui.Block<code> GUI class.
     */
    jsx3.Class.defineClass(
            "ux.cdb.admin.loan.offerLoan.OfferLoanDetails",
            ux.megatron.gui.Block,
            null,
            function (objRoot) {
                objRoot.prototype.initUI = function() {
                };
                objRoot.prototype.onPageChange = function(msg) {
                    this.currentPage = msg.currentPageNumber;
                    this.loadDetail(this.recordId);
                }
                objRoot.prototype.loadPageControler = function() {
                    if (!this.pageControlInit) {
                        this.pageCtrler.initialize();
                        this.pageControlInit = true;
                    }
                    this.pageCtrler.setValue(this.currentPage, this.totalPages, this.defaultPageSize, this.totalRecordCount);
                    this.pageCtrler.bindWithMatrix(this, this.onPageChange, this.getMatrix());
                }
                objRoot.prototype.onAfterDeserialize = function() {
                    try{
                        this.pageCtrler = this.get("blkPageWheel");
                        this.defaultPageSize = 15;
                        this.totalRecordCount = 0;
                        this.currentPage = 1;
                        this.pageControlInit = false;
                        this.totalPages = 0;
                        this.loadPageControler();
                    } catch(ex) {
                        console.log(ex);
                    }
                };
                objRoot.prototype.onRefreshClicked = function() {
                    this.loadDetail(this.recordId);
                };
                objRoot.prototype.loadDetail = function(status, strRECORDID){
                    this.recordId = strRECORDID;
                    var me = this;
                    try{
                        var record = this.getMainMatrix().getRecord(strRECORDID);
                    } catch(ex) {
                    }
                    var params = [status, record["batchApproveInfoId"], this.currentPage, this.defaultPageSize];
                    ux.megatron.util.Dwr.callDwr("RetailStudentLoanDistributionStatusUCC", "getBatchContractParticulars", params, this, function(dwrObject){
                        try{
                            this.totalRecordCount = dwrObject.content.page.count;
                            this.loadPageControler();
                            dwrObject = dwrObject.content.data;
                            me.initUI();
                            var cdfDoc = ux.megatron.util.Dwr.toCdfDocument(dwrObject, "jsxroot", {"PKey": "jsxid"});
                            this.getServer().getCache().setDocument(this.getMatrix().getXMLId(), cdfDoc);
                            this.getMatrix().repaint();
                        } catch(ex) {
                        }
                    }, "RetailStudentLoanDistributionStatusUCC");
                };
                objRoot.prototype.getMainMatrix = function() {
                    return this.getAncestorOfType("ux.cdb.admin.loan.offerLoan.OfferLoan").getDescendantOfName("mtxMain");
                };
                objRoot.prototype.getMatrix = function() {
                    return this.getDescendantOfName("mtxDetails");
                };
                objRoot.prototype.onMatrixExecuted = function(objMtx, objEVENT, strRECORDID){
                    var parent = ux.megatron.Main.getServer().getBodyBlock();
                    var record = objMtx.getRecord(strRECORDID);
                    this.selectRecordId = record["appBasicInfoId"];
                    this.studentId = record["studentId"];
                    ux.megatron.Main.loadUIResourceAsync(parent,  
                        "ux.cdb.admin","ux/cdb/admin/queries/loan/ui/detaildialog.xml", this,  this.dialogLoaded);
                };
                objRoot.prototype.dialogLoaded = function(objEvent){
                    try{
                        var obj = objEvent.obj.getDescendantsOfType("ux.cdb.admin.loan.LoanManageTebbedpane")[0];
                        obj.selectRecordId = this.selectRecordId;
                        obj.studentId = this.studentId;
                        obj.loadTabDetail();
                    } catch(ex) {
                        console.log(ex);
                    }
                };

                objRoot.prototype.onExport = function(){
                    //var batchApprovalInfoId = this.getDescendantOfName("mtxMain").getSelectedNodes().get(0).getAttribute("batchApprovalInfoId");
					var batchApprovalInfoId = this.recordId;
					this.get("iframeExport").setSrc("/dwr/RetailStudentLoanDistributionStatusServlet?BatchApproveInfoId=" + batchApprovalInfoId);
                };
            }
    )
}